<template>
  <div class="header-info">
    <div class="list-item-setting">
      <div class="title-info">
        <el-divider content-position="left">头部设置</el-divider>
      </div>
      <el-form-item label="区域高度">
        <el-input-number
            :min="0"
            size="small"
            v-model="optionsInfo.headHeight"
        />
      </el-form-item>
      <el-form-item label="背景颜色">
        <el-color-picker
            size="small"
            show-alpha
            :predefine="predefineColors"
            v-model="optionsInfo.backgroundColor"
        />
      </el-form-item>
    </div>
    <!--科室设置-->
    <div class="list-item-setting">
      <div class="title-info">
        <el-divider content-position="left">科室设置</el-divider>
      </div>
      <el-form-item label="科室隐藏">
        <el-switch v-model="optionsInfo.deptHide"/>
      </el-form-item>

      <el-form-item label="诊室隐藏">
        <el-switch v-model="optionsInfo.roomHide" :disabled="true"/>
      </el-form-item>

      <!--诊室选中字段-->
      <template v-if="!optionsInfo['roomHide']">
        <roomNameKeyEditor
            :designer="designer"
            :selected-widget="selectedWidget"
            :option-model="optionModel"
        />
      </template>

    </div>
    <!--候诊就诊设置-->
    <div class="list-item-setting">
      <div class="title-info">
        <el-divider content-position="left">候诊就诊设置</el-divider>
      </div>
      <el-form-item label="候诊就诊" class="wait-patient-set">
        <el-radio-group v-model="optionsInfo.waitMode">
          <el-radio :label="item.value" v-for="item in options" :key="item.value">{{ item.label }}</el-radio>
        </el-radio-group>
      </el-form-item>
    </div>
  </div>
</template>

<script>
import constantDic from "@/utils/vue-i18n/lang/zh-CN";
import roomNameKeyEditor
  from "@sc/templateDetails/modules/homeRight/property-editor/module/scene-edit/basicInfo/roomNameKey-editor.vue";
import * as types from "@c/public/form-designer/devType/datas-types";

export default {
  name: "DRCDoubleInfoConfig-editor",
  components: {roomNameKeyEditor},
  componentName: "DRCDoubleInfoConfig-editor",
  mixins: [],

  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
  },

  inject: ['serverFieldList', 'getDesignerConfig'],

  data() {
    return {
      radio: 1,
      options: [
        {
          value: 1,
          label: '叫1等1'
        },
        {
          value: 2,
          label: '叫1等2'
        }
      ],
      optionsInfo:Object(),
      constantDic: constantDic,
      predefineColors: types['predefineColors'],
    }
  },

  watch: {
    // 组件的所有信息
    optionModel: {
      handler: function (val) {
        this.optionsInfo = val[val.config];
      },
      deep: true,
      immediate: true
    }
  }

}
</script>


<style lang="scss" scoped>
.wait-patient-set{
  display: flex;
  flex-direction: column;
  ::v-deep .el-form-item__label{
    width: 100% !important;
  }
  ::v-deep .el-form-item__content{
    margin-left: 0 !important; ;
    .el-radio-group{
      display: flex;
      flex-direction: column;
      .el-radio{
        padding: 10px 0;
      }
    }
  }

}


</style>